home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / C / WLIB.ZIP / WDOS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  2.1 KB  |  77 lines

  1. #ifndef WDOSIncluded
  2. #define WDOSIncluded
  3.  
  4. // copyright (c) 1992, 1993 by Paul Wheaton
  5. // 1916 Brooks #205, Missoula, MT  59801
  6. //
  7. //       phone:  (406)543-1928
  8. //  CompuServe:  72707,207
  9. //    Internet:  72707.207@CompuServe.com
  10.  
  11. #include <WTime.h>
  12. #include <WLink.h>
  13. #include <WFile.h>
  14. #include <WStr.h>
  15.  
  16. typedef char FileNameType[13];
  17.  
  18. struct DirElementType
  19.   {
  20.     FileNameType Name;
  21.     Moment M;
  22.   };
  23.  
  24. CreateLinkedListClass(Directory,DirElementType);
  25.  
  26. void LoadDirectory(const char* DirMask,Moment StartMoment,Directory& D);
  27. void LoadDirectory(const char* DirMask,Directory& D);
  28. long DirCount(const char* DirMask);  // how many files match dirmask
  29.  
  30. typedef union
  31.   {
  32.     REGS R;
  33.     Word W[7];
  34.     Byte B[8];
  35.   } URegsType;
  36.  
  37. class Registers
  38.   {
  39.       URegsType UR;
  40.       friend void CallBIOS(Byte IntNum, Registers& R);
  41.     public:
  42.       Registers(Word ax=0,Word bx=0,Word cx=0,Word dx=0)
  43.           {AX()=ax;BX()=bx;CX()=cx;DX()=dx;}
  44.       Word& AX(){return UR.W[0];}
  45.       Word& BX(){return UR.W[1];}
  46.       Word& CX(){return UR.W[2];}
  47.       Word& DX(){return UR.W[3];}
  48.       Word& SI(){return UR.W[4];}
  49.       Word& DI(){return UR.W[5];}
  50.       Word& Flags(){return UR.W[6];}
  51.       Bool CF(){return ((UR.W[6]&1)>0);}
  52.       Bool PF(){return ((UR.W[6]&4)>0);}
  53.       Bool AF(){return ((UR.W[6]&16)>0);}
  54.       Bool ZF(){return ((UR.W[6]&64)>0);}
  55.       Bool SF(){return ((UR.W[6]&128)>0);}
  56.       Bool TF(){return ((UR.W[6]&256)>0);}
  57.       Bool IF(){return ((UR.W[6]&512)>0);}
  58.       Bool DF(){return ((UR.W[6]&1024)>0);}
  59.       Bool OF(){return ((UR.W[6]&2048)>0);}
  60.       Byte& AL(){return UR.B[0];}
  61.       Byte& AH(){return UR.B[1];}
  62.       Byte& BL(){return UR.B[2];}
  63.       Byte& BH(){return UR.B[3];}
  64.       Byte& CL(){return UR.B[4];}
  65.       Byte& CH(){return UR.B[5];}
  66.       Byte& DL(){return UR.B[6];}
  67.       Byte& DH(){return UR.B[7];}
  68.       #ifdef MAJORBBS
  69.         void* operator new(size_t size){return malloc(size);}
  70.         void  operator delete(void* p) {free(p);}
  71.       #endif
  72.   };
  73.  
  74. inline void CallBIOS(Byte IntNum, Registers& R){int86(IntNum,&R.UR.R,&R.UR.R);}
  75.  
  76. #endif
  77.